package sunshine.sun.cn.notifidemo;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Environment;
import android.telephony.TelephonyManager;

/**
 * Created by SunFuLin on 2019/7/4.
 */

public class DeviceUtils {

    /**
     * 获取设备序列号，即IMEI号
     *
     * @param context 上下文
     * @return
     */
    @SuppressLint("MissingPermission")
    public static String GetDeviceIMEI(Context context) {
        TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
        String _deviceId = TelephonyMgr.getDeviceId();
        return _deviceId;
    }
    /**
     * 获取内部SD卡存储路径
     *
     * @param path
     * @return
     */
    public static String getInternalPath(String path) {
        return Environment.getExternalStorageDirectory().getAbsolutePath() + path;
    }

}
